package com.sas.service.impl;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sas.dao.ResourcesDao;
import com.sas.entity.Resources;
import com.sas.entity.Resources_er;
import com.sas.entity.User;
import com.sas.service.ResourcesService;


/**
 * 资源基本信息DAO
 * 2017-11-20
 * @author 胡其安
 * 
 */
@Service("resourcesService")
public class ResourcesServiceImpl implements ResourcesService {
	
	@Autowired
	ResourcesDao resourcesdao;
	
	@Override
	public List<Resources> select_resources_all()
			throws Exception {
		// TODO Auto-generated method stub
		return resourcesdao.select_resources_all(null);
	}

	@Override
	public List<Resources> select_resources_by_userid(User user)
			throws Exception {
		// TODO Auto-generated method stub
		Resources resources=new Resources();
		//得到角色
		resources.setRole_code(user.getUser_type());
		return resourcesdao.select_resources_by_userid(resources);
	}

	@Override
	public int deleteResourcesByUserid(Resources resources) throws Exception {
		// TODO Auto-generated method stub
		return resourcesdao.deleteResourcesByUserid(resources);
	}

	@Override
	public void insertResources(Resources resources) throws Exception {
		// TODO Auto-generated method stub
		resourcesdao.insertResources(resources);
	}

	
	
	
}
